<template>
  <el-table
    :data="tableData"
    height="calc(100vh - 140px)"
    style="min-width: 100%"
    @row-click="setDetail"
  >
    <el-table-column
      prop="clientName"
      min-width="100px"
      label="当事人"
      header-align="center"
      align="center"
    ></el-table-column>
    <el-table-column
      prop="clientGroup"
      min-width="80px"
      label="班组"
      header-align="center"
      align="center"
      v-if="!lite"
    ></el-table-column>
    <el-table-column
      prop="clientOffice"
      min-width="100px"
      label="科室"
      header-align="center"
      align="center"
      v-if="!lite"
    ></el-table-column>
    <el-table-column
      prop="eventTime"
      min-width="200px"
      label="时间"
      header-align="center"
      align="center"
    ></el-table-column>
    <el-table-column prop="category" min-width="100px" label="纠违类别"></el-table-column>
    <el-table-column prop="item" label="纠违项目" min-width="300px"></el-table-column>
    <el-table-column prop="description" label="文字描述" min-width="500px" v-if="!lite"></el-table-column>
    <el-table-column
      prop="userName"
      label="提交人"
      min-width="100px"
      v-if="!lite"
      header-align="center"
      align="center"
    ></el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    tableData: { type: Array, required: true },
    lite: { type: Boolean, required: false, default: false }
  },
  components: {
  },
  methods: {
    setDetail(row) {
      this.$emit("rowSelected", row);
    }
  }
};
</script>
